import Vue from 'vue'
import Vuex from 'vuex'
import creatPersistedstate from "vuex-persistedstate"
Vue.use(Vuex)
import mSort from "./modules/mSort/index"
import goods from "./modules/goods/index"
import member from "./modules/member/index"
import banner from "./modules/banner/index"
import seck from "./modules/seck/index"
export default new Vuex.Store({
  //数据持久化，协助存储在sessionStorage
  plugins:[creatPersistedstate({
   storage:window.sessionStorage
  
  })],  
  state: {
    userInfo:null
  },
  mutations: {
    setUserInfo(state,data){
        state.userInfo = data
    }
  },
  actions: {
  },
  modules: {
    mSort,
    goods,
    member,
    banner,
    seck
  }
})
